package com.whosly.study.webflux.controller;

import com.example.grpc.openapi.CreateOpenAPI;
import com.example.grpc.openapi.request.CreateRequest;
import com.example.grpc.openapi.response.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author fengyang(yueny09 @ 163.com)
 * @date 2022年05月07日 下午7:52
 */
@RestController
public class GetController {
    @Autowired
    private CreateOpenAPI createOpenApi;


    /**
     * http://localhost:8051/get
     *
     */
    @RequestMapping("/get")
    public String greetingService() {

        CreateRequest request = new CreateRequest("name", "coo");

        ResponseResult<Boolean> rs = createOpenApi.create(request);

        return "result: " + rs;
    }

}
